//自动加载所有VUE组件
let components = (rc => {
  let result = [];
  rc.forEach(r => {
    r.keys().forEach((key) => {
      const name = key.substring(2, key.indexOf('.vue'));
      const item = {
        install: function (Vue) {
          Vue.component(name, r(key).default)
        }
      }
      result.push(item);
    });
  });
  return result;
})([require.context('./', true, /\.vue$/),
  require.context('../business/components/', true, /\.vue$/),
  require.context('../ui/component/', true, /\.vue$/)
]);

export default [
  ...components
];
